/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.test;


import com.comac.ins.common.excel.utils.ExcelUtil;
import com.comac.ins.isfd.domain.bo.IsfdLayupSkinPropertieBo;
import com.comac.ins.isfd.domain.vo.IsfdLayupSkinPropertieVo;
import com.comac.ins.isfd.service.IIsfdLayupSkinPropertieService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

@SpringBootTest
public class IsfdLayupSkinPropertieTest {

    @Autowired
    private IIsfdLayupSkinPropertieService iIsfdLayupSkinPropertieService;

    @Test
    public void test1() {
        IsfdLayupSkinPropertieBo isfdLayupSkinPropertieBo = new IsfdLayupSkinPropertieBo();
//        List<IsfdLayupSkinPropertieVo> isfdLayupSkinPropertieVos = iIsfdLayupSkinPropertieService.queryList(isfdLayupSkinPropertieBo);

        Path filePath = Paths.get("C:\\Users\\86166\\Desktop\\要素库项目\\铺层库\\导入数据\\蒙皮属性库.xlsx");

        try (InputStream inputStream = Files.newInputStream(filePath)) {
            List<IsfdLayupSkinPropertieVo> targetVo = ExcelUtil.importExcel(inputStream, IsfdLayupSkinPropertieVo.class);
            for (IsfdLayupSkinPropertieVo vo : targetVo) {
                IsfdLayupSkinPropertieBo bo = new IsfdLayupSkinPropertieBo();
                bo.setPlyCode(vo.getPlyCode());
                bo.setMaterial(vo.getMaterial());
                bo.setThickness(vo.getThickness());
                bo.setSymmetrical(vo.getSymmetrical());
//                bo.setData(vo.getData());
//                iIsfdLayupSkinPropertieService.insertByBo(bo);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("hxloongs");
    }
}
